package com.cait.cait.util;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author Jirath
 * @date 2020/2/14
 * @description:
 */
@PropertySource("classpath:properties/mem-cate-name.properties")
@Component
@ConfigurationProperties(prefix = "role")
@Data
public class MemberCategoryNameUtil {
    private String member;
    private String worker;
    private String manager;
    private String chairman;
    public String getNameByCatId(int categoryId){
        switch (categoryId){
            case 0:
                return manager;
            case 1:
                return worker;
            case 2:
                return manager;
            case 3:
                return chairman;
            default:
                return member;
        }
    }
}
